<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>生命周期的使用举例-mounted</title>
    <script src="../../../lib/jquery-3.6.0.js"></script>
</head>
<body>
<div id="app">
    <select>
        <option v-for="city in cities" :value="city.id">{{city.name}}</option>
    </select>
</div>
</body>
<script src="../../../lib/vue.js"></script>
<!--<script src="../mock/cities.component"></script>-->
<script src="../../../lib/jquery-3.6.0.js"></script>

<script>
    new Vue({
        el: '#app',
        data: {
            cities: []
        }, mounted: function () {
            var _this = this;
            $.ajax({
                url:'../mock/cities.json',
                method:'get',
                dataType:'json',
                success:function (data) {
                    _this.cities = data;
                }
            })

        }
    })

</script>
</html>